<template>
  <div>
    <div>
      <Commonhead
        datum="精彩跟帖"
        @click.native="$router.push('/postDetail/' + $route.params.id)"
      ></Commonhead>
    </div>

    <Main
      v-for="Comment in commentlist"
      :key="Comment.id"
      :parentData="Comment"
    ></Main>
  </div>
</template>

<script>
import Commonhead from "../../components/Commonhead";
import Main from "../../components/Comment/Main";
export default {
  components: { Commonhead, Main },

  data() {
    return {
      commentlist: [],
    };
  },
  created() {
    this.$axios({
      url: "post_comment/" + this.$route.params.id,
    }).then((res) => {
      console.log(res.data);
      this.commentlist = res.data.data;
    });
  },
};
</script>

<style>
</style>